package com.zs.zcerp.approval.controller;

import com.zs.zcerp.approval.entity.*;
import com.zs.zcerp.approval.service.IMailService;
import com.zs.zcerp.common.annotation.ControllerEndpoint;
import com.zs.zcerp.common.controller.BaseController;
import com.zs.zcerp.common.entity.FebsResponse;
import com.zs.zcerp.common.exception.FebsException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;


/**
 * 签核
 *
 * @author Henry
 * @email *****@mail.com
 * @date 2021-04-09 20:58:44
 */
@Slf4j
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("syMail")
public class SyMailController extends BaseController {
    private static final String TO = "henry.lv@v-fw.com";
    private static final String SUBJECT = "测试邮件";
    private static final String CONTENT = "test content";


    private IMailService mailService;

    @PostMapping("send")
    @ControllerEndpoint(operation = "新增签核人员", exceptionMessage = "新增签核人员失败")
    public FebsResponse bacthAdd() throws Exception {

        String htmlStr = "<h1>Test</h1>";
        mailService.sendTextMail(TO,  SUBJECT,  htmlStr);
        return new FebsResponse().success();
    }


}
